﻿@model TextModel
@{
    ViewBag.Title = "Text";
}

<h2>Text</h2>

<p>The text binding causes the associated DOM element to display the text value of your parameter.</p>
<p>Typically this is useful with elements like &lt;span&gt; or &lt;em&gt; that traditionally display text, but technically you can use it with any element.</p>
<p><a href="http://knockoutjs.com/documentation/text-binding.html" target="_blank">http://knockoutjs.com/documentation/text-binding.html</a></p>

@Html.VisiTogglerFromPartial(CodeSamplePartials.TEXT_VIEW_MODEL, Html.CreateVisiToggler("show the samples view model C# source code ", htmlAttributes: new { @class = "onright" }, options: VisiOptions.HiddenByDefault))
<br />
@Html.VisiTogglerFromPartial(CodeSamplePartials.TEXT_CONTROLLER, Html.CreateVisiToggler("show the samples controller C# source code ", htmlAttributes: new { @class = "onright" }, options: VisiOptions.HiddenByDefault))


<h3>Sample #1</h3>

<p>Today's message is: <span @Html.KoAttrText(m => m.MyMessage)></span></p>

@Html.VisiTogglerFromPartial(CodeSamplePartials.TEXT1, Html.CreateVisiToggler("show the sample source code ", htmlAttributes: new { @class = "onright" }, options: VisiOptions.HiddenByDefault))

<h3>Sample #2</h3>

<p>Computed sample is coming soon</p>

<h3>Sample #3</h3>

<p>The item is <span @Html.KoAttrText(m => m.Price > 50 ? "expensive" : "affordable")></span> today.</p>

@Html.VisiTogglerFromPartial(CodeSamplePartials.TEXT3, Html.CreateVisiToggler("show the sample source code ", htmlAttributes: new { @class = "onright" }, options: VisiOptions.HiddenByDefault))

<h3>Sample #4</h3>

<p>Containerless control flow syntax</p>

<p>Today's message is: @Html.KoText(m => m.MyMessage)</p>

@Html.VisiTogglerFromPartial(CodeSamplePartials.TEXT4, Html.CreateVisiToggler("show the sample source code ", htmlAttributes: new { @class = "onright" }, options: VisiOptions.HiddenByDefault))

<p>&nbsp;</p>
<p>Next &gt; @Html.ActionLink("Html", "Html", "Examples")</p>


@Model.ApplyBindingsScript(KoBindingOptions.IncludeData)